﻿using ReactiveUI.Fody.Helpers;
using ReactiveUI;
using System.Collections.ObjectModel;

namespace WPF_CoverView_Demo.Models
{
    public class ShowedData : ReactiveObject
    {
        [Reactive]
        public int ChannelId { get; set; }  // 通道编号

        [Reactive]
        public string ChannelName { get; set; }  // 通道名称

        [Reactive]
        public string SensorName { get; set; }  // 传感器名称

        [Reactive]
        public string Description { get; set; }  // 描述

        [Reactive]
        public string SensorType { get; set; }  // 传感器类型

        [Reactive]
        public string DisplayUnit { get; set; }  // 显示单位

        [Reactive]
        public double Sensitivity { get; set; }  // 传感器灵敏度

        [Reactive]
        public ObservableCollection<DataPoint> DataPoints { get; set; }  // 点数据列表

        public ShowedData(int id, string cname, string sname, string description, string sensorType, string displayUnit, double sensitivity)
        {
            ChannelId = id;
            ChannelName = cname;
            SensorName = sname;
            Description = description;
            SensorType = sensorType;
            DisplayUnit = displayUnit;
            Sensitivity = sensitivity;
            DataPoints = new ObservableCollection<DataPoint>();  // 初始化为空，动态添加
        }
    }

    public class DataPoint : ReactiveObject
    {
        [Reactive]
        public int Number { get; set; }  // 序号

        [Reactive]
        public double Amplitude { get; set; }  // 幅值

        [Reactive]
        public double Phase { get; set; }  // 相位

        [Reactive]
        public double Speed { get; set; }  // 速度
    }
}
